import Arrow from "./arrow";
import Gateway from "./gateway";
import IPosition from "./IPosition";
import IShape from "./IShape";
import Park from "./park";
import Pillar from "./pillar";

class ParkingLot {
  /**地面 */
  floors: IShape[] = [];
  /**车位列表 */
  parks: Park[] = [];
  /**柱子列表 */
  pillars: Pillar[] = [];
  /**路径箭头列表 */
  arrows: Arrow[] = [];
  /**出入口 */
  gateways: Gateway[] = [];
  /**车位坐标字典 */
  private posDict: { [name: string]: IPosition } = {};

  /**
   * 通过车位名字获取坐标
   * @param name 车位名字
   */
  getPositionByName: (name: string) => IPosition = (name) => {
    let rst: IPosition;
    rst = this.posDict[name];
    return rst;
  };

  /**
   * 计算路径
   * @param from 起始点
   * @param to 目标点
   */
  getPath: (from: IPosition, to: IPosition) => IPosition[] = (from, to) => {
    let rst: IPosition[] = [];
    return rst;
  };
}

export default ParkingLot;
